﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
public partial class master_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public static string getCargoId(string cargo_id)
    {
        ModPersona mp = new ModPersona();
        Tbl_Cargos cargo = mp.getCargo(Convert.ToInt32(cargo_id));

        return (cargo != null) ? cargo.sNombre_Cargo : "null";
    }
    protected void add_Click(object sender, EventArgs e)
    {
        Response.Redirect("PersonalForm.aspx?iPersona_id=0");
    }

    [WebMethod]
    public static bool EliminarPersonal(string sPersona)
    {
        int iPersona = Convert.ToInt32(sPersona);
        ModPersona modPersona = new ModPersona();
        Tbl_Personas personaActual = modPersona.getPersona(iPersona);
        return (personaActual != null) ? modPersona.deletePersona(personaActual) : false;
    }
}